<h1 id="head">Admin page </h1>
<?php
$classes = array(
    'home' => $action == 'index' ? 'active' : NULL,
    'products' => $action == 'works' ? 'active' : NULL,
    'news' => $action == 'companies' ? 'active' : NULL,
    'categories' => $action == 'keywords' ? 'active' : NULL,
    'login' => $action == 'login' ? 'active' : NULL,
);
?>
<div id="navigation">
    <ul>
        <li><a href="<?php echo base_url() ?>">View site</a></span></li>
        <li class="<?php echo $classes['products'] ?>"><a href="<?php echo base_url('admin/index') ?>">Products</a></span></li>
        <li class="<?php echo $classes['news'] ?>"><a href="<?php echo base_url('admin/news') ?>">News</a></span></li>
        <li class="<?php echo $classes['categories'] ?> navlist" >
                <a href="<?php echo base_url('admin/categories') ?>">Categories</a>
        </li>
        <?php if (!$this->session->userdata('validated')) : ?>
            <li class="<?php echo $classes['login'] ?>"><a href="<?php echo base_url('admin/login') ?>">Login</a></li> 
        <?php else: ?>
            <li class="<?php echo $classes['login'] ?>"><a href="<?php echo base_url('admin/logout') ?>">Logout</a></li>
        <?php endif; ?>
    </ul>
    <div style="clear: both"></div>
</div>